@import '@/styles/common/variables.scss';
.productItem{
  width: 31%;
  background-color: #ffffff;
  margin-right: 3.3%;
  overflow: hidden;
  cursor: pointer;
  &:nth-of-type(3n){
    margin-right: 0;
  }
  display: inline-block;
  position: relative;
  padding-bottom: 24px;
  vertical-align: top;
  font-size: 0;
  &.productItem_switch{
    .product_image{
      &:hover{
        .switch_container{
          display: flex;
        }
      }
    }

  }
  .product_image{
    width: 100%;
    padding-bottom: 100%;
    background-repeat: no-repeat;
    background-size: cover;
    background-color: #ebeaea;
    cursor: pointer;
    height: 0;
    position: relative;
    
    .switch_container{
      width: 100%;
      position: absolute;
      top: 50%;
      left: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: -24px;
      display: none;
      span{
        display: inline-block;
        background-color: #ffffff;
        width: 56px;
        height: 48px;
        text-align: center;
        line-height: 48px ;
        font-size: 0;
        &:hover{
          i{
            color: #363434;
          }
        }
        i{
          font-size: 12px;
          display: inline-block;
        }
        &:last-of-type{
          i{
            -webkit-transform: rotateZ(180deg);
            -moz-transform: rotateZ(180deg);
            -o-transform: rotateZ(180deg);
            -ms-transform: rotateZ(180deg);
            transform: (180deg);
            
          }
        }
      }
    }
  }
  >.el-image{
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    overflow: hidden;
    background-color: #ebeaea;
    cursor: pointer;
    img,.el-image__error{
      position: absolute;
      width: 100%;
      cursor: pointer;
      &:hover{
        transform: scale(1.12) translateZ(0);
      }
      transition:  transform .4s ease-out ;
    }
    
  }
  >.title{
    margin-top: 12px;
    color: #363434;
    // font-size: 20px;
    @include fontSize(20px);
    height: 56px;
    text-align: left;
  }

  .tag{
    position: absolute;
    top: 16px;
    left: 16px;
    color: #7E7E7E;
    font-size: 14px;
    overflow: hidden;
    text-align: center;
  }
  .collect{
    position: absolute;
    top: 24px;
    right: 24px;
  }
  .icon-plus{
    position: absolute;
    top: 0;
    right: 0;
    font-size: 24px;
    top: 16px;
    right: 16px;
    &:hover{
      color: #363434;
    }
  }
}


.colorList{
  display: flex;
  align-items: center;
  >p.color{
    width: 16px;
    height: 16px;
    background-color: #ccc;
    position: relative;
    font-size: 0;
    margin:0 9px;
    -webkit-box-shadow: inset 0 1px 1px 0 rgba(0,0,0,0.2);
    box-shadow: inset 0 1px 1px 0 rgba(0,0,0,0.2);
    display: block;
    overflow: visible;
    cursor: pointer;

    &:first-of-type{
      margin-left: 4px;
    }
    &.color_disabled{
      &:hover{
       &::before{
        opacity: 0;
      }
      }
      
    }
    &.color_active{
      opacity: 1;
      &::before{
        opacity: 1;
        -webkit-transform: scale(0.98);
        transform: scale(0.98);
      }
      &:hover{
        &::before{
          opacity: 1;
          -webkit-transform: scale(0.98);
          transform: scale(0.98);
        }
      }
    }
    .icon-shade{
      position: absolute;
      top: -1px;
      left: -1px;
      color: none;
      width: calc(100% + 2px);
      height: calc(100% + 2px);
    }
    &::before{
      content: '';
      display: block;
      position: absolute;
      top: -4px;
      right: -4px;
      left: -4px;
      bottom: -4px;
      border: 1.5px solid #363434;
      -webkit-transform: scale(0);
      transform: scale(0);
      opacity: 0;
      -webkit-transition: opacity .15s linear,-webkit-transform .3s cubic-bezier(0.25,0.46,0.45,0.94);
      transition: opacity .15s linear,-webkit-transform .3s cubic-bezier(0.25,0.46,0.45,0.94);
      transition: transform .3s cubic-bezier(0.25,0.46,0.45,0.94),opacity .15s linear;
      transition: transform .3s cubic-bezier(0.25,0.46,0.45,0.94),opacity .15s linear,-webkit-transform .3s cubic-bezier(0.25,0.46,0.45,0.94);
    }
    &:hover{
      &::before{
        opacity: 1;
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
      }
    }
  }
}
.specList{
  min-height: 28px;
  >p.spec{
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
    cursor: pointer;
    height: 28px;
    line-height: 28px;
    text-align: center;
    margin-right: 8px;
    color: #7E7E7E;
    font-size: 14px;
    padding: 0 12px;
    border-radius: 5px;
    border: 1px solid #F2F1F0;
    // float: left;
    margin-bottom: 5px;
    display: inline-block;
    &:hover,
    &.spec_active{
      border-color: #363434;
      color: #363434;
      // font-weight: bold;
    }
    &.diabled{
      border-color: #F2F1F0;
      text-decoration: line-through;
      color: #cdcdcd;
      background-color: #f9f9f9;
    }

  }

}
.comment{
  display: flex;
  font-size: 14px;
  white-space: nowrap;
}

.comment{
  .el-rate__icon{
    margin-right: -2px;
  }

  .el-rate__text{
    margin-left: 8px;
    color: #FEBD69 !important;
  }
}

.productItem_content{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.productItem{
  @include respond('768'){
    .tag{
      top: 8px;
      left: 8px;
    }
    &.productItem_switch{
      &:hover{
        .product_image .switch_container{
          display: none;
        }
      }
    }
    .productItem_content{
      height: 46px;
    }
    .icon-plus{
      display: none;
    }
    .title{
      margin-top: 12px;
      font-weight: 700;
      font-size: 16px;
    }
  }
}
